<?php

class myCheckContact {

  var $name;
  var $email;
  var $comment;

  function checkName() {
    // Check for at least 3 characters.
    if (!eregi ("^[[:alpha:].' -]{3,}$", $this->name)) {
      return (false);
    } else {
      return (true);
    }
  }

  function checkEmail() {
    // Check for a valid email address.
    if (!eregi ("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$", $this->email)) {
      return (false);
    } else {
      return (true);
    }
  }

  function checkComment() {
    // Check for a comment.
    if (strlen($this->comment) < 1) {
      return (false);
    } else {
      return (true);
    }
  }

}

?>